<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>recursivelyCheckEqual</title>
</head>

<body>
    <div>打开浏览器控制台查看结果</div>
    <script>
        const recursivelyCheckEqual = (a, ...rest) => Object.is(a, rest[0]) && (rest.length < 2 || recursivelyCheckEqual(...rest));
        console.log(recursivelyCheckEqual('x' * 1, Number('true'), NaN)); // true
        console.log(recursivelyCheckEqual(NaN, NaN, 1)); //false
        console.log(recursivelyCheckEqual(+true, Number('1'), 1)); //true
    </script>
</body>

</html>